<script src="<?php echo base_url();?>js/gallery.js?<?php echo time(); ?>" type="text/javascript"></script>
<?php if($open_avatar) : ?>
<script type="text/javascript">
$(document).ready(function () {
  $.colorbox({href:'<?php echo base_url() . '/gallery/single/' . $open_avatar; ?>'});
});
</script>
<?php endif;?>
<div id="gallery-index">
  <div id="gallery-my-avatar-link"><?php echo anchor('participate', "Моята Кандидатура"); ?></div>
  <div id="gallery">
    <?php foreach ($avatars as $key => $avatar) : ?>
    <div class="avatar-wrapper">
      <div class="avatar-image">
        <a class="avatar-single-link" href="<?php echo base_url() . 'gallery/single/' . $avatar['id'] ?>"><img src="<?php echo base_url() . 'uploads/t_' . $avatar['filename'] ?>" />
        </a>
        <div class="avatar-first-part-sentence">В интернет имам право <?php echo $first_parts[$avatar['first_part_sentence']]; ?>...</div>
      </div>
      <div class="avatar-votes"><?php echo $avatar['votes']?></div>
      <div class="avtar-name"><?php echo $avatar['first_name'] . ' ' . mb_substr($avatar['last_name'], 0, 1) .'.' ?></div>
    </div>
    <?php endforeach; ?>
    <div class="clear-both"></div>
    <div id="pager-section"><?php echo $pager_html; ?></div>
  </div>
</div>